IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[GetsponsorByRolId]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[GetsponsorByRolId]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
             
CREATE PROCEDURE [dbo].[GetsponsorByRolId]   
(    
 @roleId INT    
)    
AS    
BEGIN    
 SET NOCOUNT ON    
  
SELECT RSM.SponsorTypeId AS 'Id',  
AST.NAME as 'Name'  
FROM admRole_Sponsor_Map RSM  
Inner join AdmSponsorType AST   
ON RSM.SponsorTypeId = AST.Id  
AND RSM.RoleId = @roleId  
   
    
 SET NOCOUNT OFF    
END    
GO
